package context

import (
	"go-test/src/com/miao/common/set"
)


type ChanManager interface {
	bind(chanel *ChannelContext, key string)
	findSet(key string) *set.Set
	unbind(chanel *ChannelContext, key string)
	unbindAll(chanel *ChannelContext)
	findId(key string) *ChannelContext
}


func BindOne(manager ChanManager,chanel *ChannelContext, key string)  {
	manager.bind(chanel, key)
}

func FindOne(manager ChanManager,key string)  *ChannelContext{
	return manager.findId(key)
}

func FindSet(manager ChanManager, key string)  *set.Set{
	return manager.findSet(key)
}

func Unbind(manager ChanManager,chanel *ChannelContext, key string)  {
	manager.unbind(chanel,key)
}

func UnbindAll(manager ChanManager,chanel *ChannelContext)  {
	manager.unbindAll(chanel)
}







